package com.ml.loan.common.redis;

import com.ml.loan.common.constants.CommonConstant;

public class BasePrefix implements iKeyPrefix {

    private long expireSeconds;

    private String prefix;

    public BasePrefix(String prefix) {
        this(0, prefix);
    }

    public BasePrefix(long expireSeconds, String prefix) {
        this.expireSeconds = expireSeconds;
        this.prefix = prefix;
    }

    @Override
    public long expireSeconds() {
        return expireSeconds;
    }

    @Override
    public String getPrefix() {
        return CommonConstant.PROJECT_NAME + "_" + getClass().getSimpleName() + ":" + prefix;
    }
}
